package com.web.exiaodao.remote.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;

import com.web.webstart.base.controller.BaseController;
import com.web.webstart.base.util.result.XaResult;
import com.web.exiaodao.remote.service.ApiConfigurationTableService;
import com.web.exiaodao.remote.vo.ConfigurationTableVo;

/**
 * @Title: ApiConfigurationTableController.java
 * @Package com.web.exiaodao.remote.controller
 * @Description: 配置表信息接口
 * @author zhanglin
 * @date 2015年3月23日 下午1:00:00
 * @version V1.0
 */
@Api(value = "ConfigurationTable", description = "配置表接口", position = 10)
@Controller
@RequestMapping("/api/configuration")
public class ApiConfigurationTableController extends BaseController {

	private static final Logger LOGGER = Logger.getLogger(ApiConfigurationTableController.class);

	@Autowired
	private ApiConfigurationTableService configurationTableService;

	/**
	 * @Title: findConfigurationTableById
	 * @Description: 根据ID查找单条实体
	 * //@param modelId
	 * @return
	 */
	@ApiOperation(value="配置信息表",notes="查询配置表详细信息,当返回的code=1时，取出object进行显示,存放为单体对象")
	@ResponseBody
	@RequestMapping(value="findConfiguration",method=RequestMethod.POST)
	public XaResult<ConfigurationTableVo> findConfigurationTableById()
			throws Exception {
		XaResult<ConfigurationTableVo> xr = new XaResult<>();
		xr =  configurationTableService.findLastOne();
		return xr;
	}
}

